<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- <a-button type="primary" icon="download" @click="handleExportXls('问题反馈信息')">导出</a-button> -->
      <!-- 高级查询区域 -->
      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
         :scroll="{x: 2000}"
        bordered
        rowKey="id" 
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
   
        <span slot="action" slot-scope="text, record">
          <a @click="handleDeal(record)">处理</a> 
        </span>
      </a-table>
    </div>

    <sys-problem-modal ref="modalForm" @ok="modalFormOk"></sys-problem-modal>
  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import SysProblemModal from './modules/SysProblemModal'
  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'

  export default {
    name: 'SysProblemList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      SysProblemModal
    },
    data () {
      return {
        description: '问题反馈管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'联系方式',
            align:"center",
            dataIndex: 'phone'
          },
          {
            title:'问题描述',
            align:"center",
            width:300,
            ellipsis:true,
            dataIndex: 'description',
          },
           
          {
            title:'反馈时间',
            align:"center",
            dataIndex: 'createTime', 
          }, 
          {
            title:'处理状态',
            align:"center",
            dataIndex: 'status_dictText'
          },
          {
            title:'处理结果',
            align:"center",
            width:300,
            dataIndex: 'result', 
          }, 
          {
            title:'处理时间',
            align:"center",
            dataIndex: 'updateTime', 
          }, 
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/veterans/sysProblem/list",
          result: "/veterans/sysProblem/result", 
          exportXlsUrl: "/veterans/sysProblem/exportXls", 

        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'phone',text:'联系方式',dictCode:''}) 
        // fieldList.push({type:'date',value:'start',text:'开始时间'})
        // fieldList.push({type:'date',value:'end',text:'结束时间'}) 
        fieldList.push({type:'string',value:'status',text:'状态',dictCode:'sys_problem_state'}) 
        this.superFieldList = fieldList
      },
      handleDeal:function(record){
        this.$refs.modalForm.edit(record);
        this.$refs.modalForm.title="问题处理";
        this.$refs.modalForm.disableSubmit = true;
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>